using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Decisions.HL7.Message;
using DecisionsFramework;

namespace Decisions.HL7.Message
{
    public class ParticipationAttribute:RuleAttribute
    {
        private Dictionary<HL7Version, string[]> validVersionCodes = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, string[]> validVersionDescriptions = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, HL7TableType> tableVersionTypes = new Dictionary<HL7Version, HL7TableType>();

        public ParticipationAttribute()
        {
            // init the values for table version types
						tableVersionTypes[HL7Version.v27] = HL7TableType.User;
			
            
			// init the values for version codes
						validVersionCodes[HL7Version.v27] = new string[]{"AD","AI","AP","ARI","AT","AUT","CP","DP","EP","EQUIP","FHCP","MDIR","OP","PB","PH","PI","PO","POMD","PP","PRI","RCT","RO","RP","RT","SB","SC","TN","TR","VP","VPS","VTS","WAY","WAYR"};
			
			// init the values for version descriptions
						validVersionDescriptions[HL7Version.v27] = new string[]{"Admitting Provider","Assistant/Alternate Interpreter","Administering Provider","Assistant Result Interpreter","Attending Provider","AUT Author/Event Initiator","Consulting Provider","Dispensing Provider","Entering Provider (probably not the same as transcriptionist)","Equipment","Family Health Care Professional","Medical Director","Ordering Provider","Packed by","Pharmacist   (not sure how to dissect Pharmacist/Treatment Supplier's Verifier ID)","Primary Interpreter","Performing Organization","Performing Organization Medical Director","Primary Care Provider","Principal Result Interpreter","Results Copies To","Responsible Observer","Referring Provider","Referred to Provider","Send by","Specimen Collector","Technician","Transcriptionist","Verifying Provider","Verifying Pharmaceutical Supplier   (not sure how to dissect Pharmacist/Treatment Supplier's Verifier ID)","Verifying Treatment Supplier   (not sure how to dissect Pharmacist/Treatment Supplier's Verifier ID)","Waypoint","Waypoint Recipient"};
			            

        }

        
        public override ValidationIssue[] RunRule(string name, object owningObject, object value)
        {
            //todo: check if the value is valid in the current version
            //if the value is not valid in the current version, add it as a validation issue


            return new ValidationIssue[0];
        }
    }
}
